package main

import "fmt"

func strStr(haystack string, needle string) int {
	haystackLength := len(haystack)
	needleLength := len(needle)

	for i := 0; i <= (haystackLength - needleLength); i++ {
		flag := true
		for k, v := range needle {
			if haystack[i+k] != byte(v) {
				flag = false
			}
		}

		if flag == true {
			return i
		}
	}

	return -1
}

func main() {
	fmt.Println(strStr("aaaaa", "bba"))
}
